// with ES6 import
import io from 'socket.io-client';

var socket = io.connect('http://localhost:20000/duhuijie',{
	transports: [ 'websocket' ]
});
// var socket = io();
console.dir(io)
console.dir(socket)
 socket.on('connect', function(){
 	console.log("-----connect",socket.connected)
 });
 socket.on('event', function(data){
 	console.log(data,"-----event")
 });
 socket.on('disconnect', function(){
 	console.log("-----disconnect")
 })

socket.on("hello", (arg) => {
  console.log(arg); // world
  let count = Number($(".count").text())
  ++count;
  $(".count").html(count)
});

socket.emit("hello", "world");